<template>
  <div v-if="Object.keys(goods).length !== 0" class="box">
    <div class="title">{{ goods.title }}</div>
    <span class="new-price">{{ goods.newPrice }}</span>
    <del class="old-price">{{ goods.oldPrice }}</del>
    <span
      class="back-color"
      :style="{ backgroundColor: goods.discountBgColor }"
      >{{ goods.discount }}</span
    >
    <div class="center">
      <div>{{ goods.columns[0] }}</div>
      <div>{{ goods.columns[1] }}</div>
      <div>{{ goods.services[goods.services.length - 1].name }}</div>
    </div>
    <div class="bottom">
      <div v-for="index in goods.services.length - 1">
        <img :src="goods.services[index - 1].icon" alt="" />
        <span>{{ goods.services[index - 1].name }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    goods: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.box {
  padding: 5px 5px 20px;
  border-bottom: 3px solid #e7e5e7;
}

.title {
  font-size: 16px;
  color: #000;
  padding-bottom: 5px;
}

.box > span,
.box > del{
  margin-right: 5px;
}

.new-price {
  font-size: 20px;
  color: #ff8f96;
}

.old-price {
  color: #ababac;
}

.back-color {
  position: relative;
  bottom: 8px;
  display: inline-block;
  width: 60px;
  text-align: center;
  border-radius: 15px;
  color: #fff;
}

.center {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-bottom: 8px;
  color: #909090;
  border-bottom: 1px solid #e4e1e1;
}

.bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

/* .bottom div {
  text-align: center;
} */

.bottom img {
  width: 13px;
  padding-bottom: 3px;
}
</style>